/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.saber.certificacao.modelos.relacionamentos.idcompostos;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author gbvbahia
 */
@Embeddable
public class IdUsuarioQuestaoPk implements Serializable{

    @Column(name = "usuario_id")
    private Long usuarioId;

    @Column(name = "questao_id")
    private Long questaoId;

    public IdUsuarioQuestaoPk() {
    }

    public IdUsuarioQuestaoPk(Long usuarioId, Long questaoId) {
        this.usuarioId = usuarioId;
        this.questaoId = questaoId;
    }

    public Long getQuestaoId() {
        return questaoId;
    }

    public void setQuestaoId(Long questaoId) {
        this.questaoId = questaoId;
    }

    public Long getUsuarioId() {
        return usuarioId;
    }

    public void setUsuarioId(Long usuarioId) {
        this.usuarioId = usuarioId;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final IdUsuarioQuestaoPk other = (IdUsuarioQuestaoPk) obj;
        if (this.usuarioId != other.usuarioId && (this.usuarioId == null || !this.usuarioId.equals(other.usuarioId))) {
            return false;
        }
        if (this.questaoId != other.questaoId && (this.questaoId == null || !this.questaoId.equals(other.questaoId))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 83 * hash + (this.usuarioId != null ? this.usuarioId.hashCode() : 0);
        return hash;
    }

}
